package ${package.IQueryapi};

import com.dtyunxi.rest.RestResponse;
import ${package.Requestdto}.${entity}ReqDto;
import ${package.Responsedto}.${entity}RespDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.GetMapping;
import com.github.pagehelper.PageInfo;

/**
* ${table.comment}服务接口
*
* @author ${author}
* @since ${date}
*/
@Api(tags = {"${table.comment}服务"})
@FeignClient(
    contextId = "${package.IQueryapi?replace('.','-')}-I${entity}QueryApi",
    name = "${cfg.feignName}",
    path = "${cfg.feignPath}",
    url = "${cfg.feignUrl}"
)
public interface I${entity}QueryApi {

    /**
    * 根据id查询${table.comment}
    *
    * @param id ${table.comment}id
    * @return   ${table.comment}数据
    */
    @GetMapping("/{id}")
    @ApiOperation(value = "根据id查询${table.comment}", notes = "根据id查询${table.comment}")
    RestResponse<${entity}RespDto> queryById(@PathVariable("id") Long id);

    /**
    * ${table.comment}分页数据
    *
    * @param filter   ${table.comment}查询条件
    * @param pageNum  当前页
    * @param pageSize 页大小
    * @return ${table.comment}分页数据
    */
    @GetMapping("/page")
    @ApiOperation(value = "${table.comment}分页数据", notes = "根据filter查询条件查询${table.comment}数据，filter=${entity}ReqDto")
    RestResponse<PageInfo<${entity}RespDto>> queryByPage(@RequestParam("filter") String filter,
                                                           @RequestParam(name = "pageNum", required = false, defaultValue = "1") Integer pageNum,
                                                           @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize);

}
